package cn.iocoder.yudao.module.system.controller.admin.mini.other.shopGuide.dal.mysql.shopguide;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.system.controller.admin.mini.other.shopGuide.controller.admin.shopguide.vo.ShopGuideExportReqVO;
import cn.iocoder.yudao.module.system.controller.admin.mini.other.shopGuide.controller.admin.shopguide.vo.ShopGuidePageReqVO;
import cn.iocoder.yudao.module.system.controller.admin.mini.other.shopGuide.dal.dataobject.shopguide.ShopGuideDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 导购 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface ShopGuideMapper extends BaseMapperX<ShopGuideDO> {

    default PageResult<ShopGuideDO> selectPage(ShopGuidePageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ShopGuideDO>()
                .betweenIfPresent(ShopGuideDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(ShopGuideDO::getName, reqVO.getName())
                .eqIfPresent(ShopGuideDO::getPhone, reqVO.getPhone())
                .eqIfPresent(ShopGuideDO::getShop, reqVO.getShop())
                .eqIfPresent(ShopGuideDO::getUrl, reqVO.getUrl())
                .orderByDesc(ShopGuideDO::getId));
    }

    default List<ShopGuideDO> selectList(ShopGuideExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<ShopGuideDO>()
                .betweenIfPresent(ShopGuideDO::getCreateTime, reqVO.getCreateTime())
                .likeIfPresent(ShopGuideDO::getName, reqVO.getName())
                .eqIfPresent(ShopGuideDO::getPhone, reqVO.getPhone())
                .eqIfPresent(ShopGuideDO::getShop, reqVO.getShop())
                .eqIfPresent(ShopGuideDO::getUrl, reqVO.getUrl())
                .orderByDesc(ShopGuideDO::getId));
    }

}
